'use strict'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const { INTEGER, DATE } = Sequelize
    await queryInterface.createTable('visitNum', {
      id: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment: '主键id'
      },
      visit_num: {
        type: INTEGER,
        allowNull: false,
        defaultValue: 0,
        comment: '访问量'
      },
      date: {
        type: DATE,
        allowNull: false,
        comment: '访问时间'
      },
      created_at: DATE,
      updated_at: DATE
    })
  },

  async down(queryInterface) {
    queryInterface.dropTable('visitNum')
  }
}
